<?php
class Slider extends CWidget
{
	public function run()
	{
		Yii::import('slider.models.SliderBanner');

		$criteria=new CDbCriteria();
		$criteria->condition='is_active=:isActive';
		$criteria->order='sort';
		$criteria->params=array(
			':isActive'=>1,
		);

		$data=SliderBanner::model()->findAll($criteria);

		if(!empty($data)){
			$this->render('slider',array(
                'data'=>$data,
            ));
		}
	}
}
